' Process a check. PRINT "What is the check amount" INPUT CHECK LET BALANCE = BALANCE - CHECK
The remaining task is to print the new balance. This is included in the complete program, seen below:
' Get the starting balance PRINT "What is the starting balance" INPUT BALANCE ' ' Determine transaction type PRINT "Type a 'D' for a deposit or a 'C' for a check" INPUT TYPE$ ' IF TYPE$ = "D" THEN ' Process a deposit. PRINT "What is the deposit amount" INPUT DEPOSIT LET BALANCE = BALANCE + DEPOSIT ELSE ' Process a check. PRINT "What is the check amount" INPUT CHECK LET BALANCE = BALANCE - CHECK END IF ' ' Print the new balance. PRINT "The new balance is", BALANCE ' END
Study the program and mentally review how the "big problem" was broken into smaller tasks, and how those tasks were implemented. Notice how the indenting and the comments help show this. Would the program be as clear with no comments and no indenting?